[3.9] gh-121285: Remove backtracking when parsing tarfile headers (GH-121286) (#123641)
authorSeth Michael Larson <seth@python.org>
Wed, 4 Sep 2024 15:46:01 +0000 (10:46 -0500)
committerRaspbian forward porter <root@raspbian.org>
Sat, 24 Jan 2026 09:41:14 +0000 (09:41 +0000)
commit7178a505405fe0db7437cbd8ab87930a426a315f
tree595bee28a39e8b763406f090a044eb182965713d
parent24fa8e66500156d930b43da10538b5f12e2ffec3
[3.9] gh-121285: Remove backtracking when parsing tarfile headers (GH-121286) (#123641)

* Remove backtracking when parsing tarfile headers
* Rewrite PAX header parsing to be stricter
* Optimize parsing of GNU extended sparse headers v0.0

(cherry picked from commit 34ddb64d088dd7ccc321f6103d23153256caa5d4)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Gbp-Pq: Name 0022-3.9-gh-121285-Remove-backtracking-when-parsing-tarfi.patch
Lib/tarfile.py
Lib/test/test_tarfile.py